home *** CD-ROM | disk | FTP | other *** search
/ Linux Cubed Series 2: Applications / Linux Cubed Series 2 - Applications.iso / math / gle-3.000 / gle-3 / gle / ptime.c < prev    next >
C/C++ Source or Header  |  1995-02-07  |  879b  |  25 lines

  1. #include <stdio.h>
  2. #include <jpidef.h>
  3. #include "int32.h"
  4. struct item_struct           /* structure for use during calls to SYS$GETUAI */
  5.   {
  6.   short len;                 /* specifies length of buffer for SYS$GETUAI call */
  7.   short code;                /* specifies item of information returned from SYS$GETUAI */
  8.   int32 *addr;                /* address of buffer used in SYS$GETUAI call */
  9.   int32 *rlen;                /* address of word which holds length of information returned */
  10.   };
  11. struct item_struct itmlst[2];  /* define itmlst which holds parameters passed to SYS$GETUAI call */
  12. ptime ()
  13. {
  14.     int st; int xxx;
  15.     static lastcpu;
  16.     int32 cputime;
  17.     itmlst[0].len = 4;
  18.     itmlst[0].code = JPI$_CPUTIM;
  19.     itmlst[0].addr = &cputime;
  20.     itmlst[0].rlen = &xxx;
  21.     st = SYS$GETJPI(0,0,0,itmlst,0,0,0);
  22.     gprint("==CPUtime %d   diff=%d \n",cputime,cputime-lastcpu);
  23.     lastcpu = cputime;
  24. }
  25.